package io;

import java.io.*;
import java.nio.charset.StandardCharsets;

public class ISRDemo {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("osw1.txt");
        InputStreamReader isr = new InputStreamReader(fis, StandardCharsets.UTF_8);
        /*
        int read()
        读取1个字符(到底读取几个字节要根据它的内容以及对应的字符集来决定)
        返回
         */
        int d ;
        while((d= isr.read())!=-1) {
            System.out.println((char) d);
        }
        isr.close();
    }
}
